package test7;

import java.util.Scanner;

public class AutomobileTest {
    public static void main(String[] args) {
        Automobile[] arry = new Automobile[3];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arry.length; i++) {
            Automobile a = new Automobile();
            System.out.print("请输入汽车的品牌：");
            String brand = sc.next();
            a.setBrand(brand);

            System.out.print("请输入汽车的价格：");
            double price = sc.nextDouble();
            a.setPrice(price);

            System.out.print("请输入汽车颜色");
            String colour = sc.next();
            a.setColour(colour);

            arry[i] = a;
        }

        for (int i = 0; i < arry.length; i++) {
            System.out.println("品牌："+arry[i].getBrand()+"价格："+arry[i].getPrice()+"颜色："+arry[i].getColour());
        }
    }
}
